﻿using System;
using CuteRibs.D3Armory.Models;
using CuteRibs.MVVMLib;

namespace CuteRibs.D3Armory.ViewModels
{
	public class SocketViewModel : ViewModelBase
	{
		private string itemUri;

		public string ItemUri
		{
			get { return this.itemUri; }
			set
			{
				if (this.itemUri != value)
				{
					this.itemUri = value;
					this.NotifyPropertyChanged("ItemUri");
				}
			}
		}

		public Gem Gem { get; set; }

		public SocketViewModel(Gem[] gems, int index)
		{
			if (gems != null && gems.Length > index)
			{
				this.Gem = gems[index];
				this.ItemUri = App.GetGemImageUri(this.Gem.Item.Icon);
			}
			else
			{
				this.Gem = null;
			}
		}
	}
}
